<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script src="https://yun.dui88.com/h5/floor_custom/skins/image-text/normal-home_single-row-image_181205/index.dev.js"></script>
  <script>
    // let tt = {
    //   name: 'zhen',
    // }
    // for (let val of tt) {
    //   console.log(val)
    // }
    let oldError = console.error
    console.error = function (error) {
      console.log('errpr==', error)
    }
    let pp = Promise.reject('error==22')
    pp.catch((error) => console.log(999, error))
    // consol.log(999)
  </script>
  <script>
    window.onerror = function (event, source, lineno, colno, error) {
      // 上报错误
      // 如果不想在控制台抛出错误，只需返回 true 即可
      console.log('error', event)
      return true
    }

    window.addEventListener(
      'unhandledrejection',
      (event) => {
        console.log(222, event)
      },
      true
    )
  </script>
</html>
